Skip to content

Include :open in the open variant#15349

Merged
RobinMalfait merged 2 commits into
tailwindlabs:nextfrom
lukewarlow:open
Jan 27, 2025
Merged

Include :open in the open variant#15349
RobinMalfait merged 2 commits into
tailwindlabs:nextfrom
lukewarlow:open

Conversation

@lukewarlow

Copy link
Copy Markdown
Contributor

Update the open variant to addtionally match the new :open pseudo class.

See spec at https://drafts.csswg.org/selectors-4/#open-state

See Chromium intent to ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/Pdo4oOXYKcA

:open matches open <details> and <dialog> elements (already covered by [open]), but also matches select elements with their picker open and inputs with their picker open.

Thanks to :is() taking a forgiving selector list, this is safe to add even with limited browser support.

@lukewarlow lukewarlow requested a review from a team as a code owner December 9, 2024 23:37
@lukewarlow lukewarlow changed the title Update open variant Include :open in the open variant Dec 10, 2024
open now matches the new `:open` pseudo class.
@lukewarlow

Copy link
Copy Markdown
Contributor Author

@RobinMalfait now that v4 is out, is this addition something you'd be open to?

@RobinMalfait

Copy link
Copy Markdown
Member

Yep, I think this is a good idea, especially because :is(…) is forgiving. Thanks!

@RobinMalfait RobinMalfait enabled auto-merge (squash) January 27, 2025 12:42

@RobinMalfait RobinMalfait left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants